package com.project.myPackage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.myPackage.entity.Carts;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CartsMapper extends BaseMapper<Carts> {
    //购物车关联商品表
    @Select(
            "SELECT c.*, p.* FROM carts c " +
             "LEFT JOIN  products p ON c.product_id = p.product_id " +
             "WHERE c.user_id = #{user_id}"
    )
   List<Map<String,Object>> getList(Integer user_id);
}
